package com.wrial.seckill.dao;
/*
 * @Author  Wrial
 * @Date Created in 16:05 2020/4/5
 * @Description
 */

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wrial.seckill.dataobject.ItemDO;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface ItemDOMapper extends BaseMapper<ItemDO> {

    @Select("select * from item")
    List<ItemDO> selectAll();

    @Update("update item set sales = sales + #{amount} where id = #{itemId} ")
    void increaseSales(Integer itemId, Integer amount);

}
